{{- $mainScript := resources.Get "js/main.js" }}
{{- $configScript := resources.Get "js/config.template.js" | resources.ExecuteAsTemplate "config.js" . -}}
{{- $customScript := resources.Get "js/custom.js" -}}
{{- $scripts := slice $configScript $mainScript -}}
{{- if $.Site.Params.utterances -}}
  {{- $scripts = $scripts | append (resources.Get "js/utterances.js") -}}
{{- end -}}
{{- $scripts = $scripts | append $customScript -}}
{{- $script := $scripts | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint -}}
<script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{- range .Site.Params.customJS -}}
<script src="{{ absURL . }}" crossorigin="anonymous"></script>
{{- end -}}
